//
//  XFImagePickerCell.swift
//  multi_show
//
//  Created by 李旭峰 on 2020/9/15.
//

import UIKit

class XFImagePickerCell: UICollectionViewCell {
    
    lazy var videoDuration: UILabel = UILabel()
    lazy var videoView: UIView = UIView()
    lazy var btnCheck: UIButton = UIButton(type: .custom)
    lazy var imageView: UIImageView = UIImageView()
    var indexPath:IndexPath!
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        self.videoDuration.font = FontAsset.PingFangSC_Medium.size(14)
        self.videoDuration.textColor = UIColor(hexStr: "#FFFFFF", alpha: 1.0)
        self.contentView.addSubview(imageView)
        self.imageView.snp.makeConstraints { (make) in
            make.leading.trailing.top.bottom.equalToSuperview()
        }
        self.contentView.addSubview(self.videoView)
        self.videoView.backgroundColor = UIColor(hexStr: "#000000", alpha: 0.2)
        self.videoView.snp.makeConstraints { (make) in
            make.leading.bottom.trailing.equalToSuperview()
            make.height.equalTo(18)
        }
        let tempImageView = UIImageView()
        self.videoView.addSubview(tempImageView)
        tempImageView.snp.makeConstraints { (make) in
            make.leading.equalToSuperview().offset(4)
            make.centerY.equalToSuperview()
            make.width.height.equalTo(14)
        }
        self.videoView.addSubview(self.videoDuration)
        self.videoDuration.snp.makeConstraints { (make) in
            make.trailing.equalToSuperview().offset(-4)
            make.centerY.equalToSuperview()
        }
        self.contentView.addSubview(self.btnCheck)
        self.btnCheck.setImage(UIImage(named: "picture_unselect"), for: .normal)
        self.btnCheck.setImage(UIImage(named: "picture_select"), for: .selected)
        self.btnCheck.snp.makeConstraints { (make) in
            make.trailing.top.equalToSuperview()
            make.width.height.equalTo(30)
        }
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
}
